﻿@using XStudio.XCRF.Data.Entities.CureInfo
@using XStudio.XCRF.Web.Models.Enums
@model CureInfo
@(Html.Telerik().Grid<CureGamma>().Name("CureGammaViewGrid").Footer(false)
.DataKeys(keys => keys.Add(gamma => gamma.ID))
.Columns(columns =>
{
    columns.ForeignKey(gamma => gamma.Place, RadioPlaceTypeInfo.SelectListItems, "Value", "Text").Title("部位").EditorTemplateName("RadioPlace");
    columns.Bound(gamma => gamma.Dose).Title("剂量").Width("170px").EditorTemplateName("NumericText");
    columns.Bound(gamma => gamma.Times).Title("次数").Width("170px").EditorTemplateName("NumericText");
    columns.Bound(gamma => gamma.Remark).Title("备注");
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Text);
        commands.Delete().ButtonType(GridButtonType.Text);
    }).Title("操作");
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text))
.DataBinding(dataBinding =>
{
    dataBinding.Ajax()
        .Select<CureInfoController>(c => c._CureGammaList(Model.ID))
        .Insert<CureInfoController>(c => c._CureGammaAdd(null, Model.ID))
        .Update<CureInfoController>(c => c._CureGammaEdit(null))
        .Delete<CureInfoController>(c => c._CureGammaDelete(null));
})
.Editable(edit => edit.Mode(GridEditMode.InLine))
)